<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Replacement Dynamic Value</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Replacement Dynamic Value
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jul 25, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <h3><a name="ReplacementDynamicValue-ReplacementDynamicValue"></a>Replacement Dynamic Value</h3>

<p>This will replace any number of parameters into a format string. The format string can also include formats for each parameter.</p>

<h3><a name="ReplacementDynamicValue-Version"></a>Version</h3>

<p>This dynamic value is available from version 1.5.0.</p>

<h3><a name="ReplacementDynamicValue-Examples"></a>Examples</h3>

<p>Basic example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;nant&gt;</span>
  <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;buildArgs&gt;</span>-t:Help<span class="code-tag">&lt;/buildArgs&gt;</span>
  <span class="code-tag">&lt;dynamicValues&gt;</span>
    <span class="code-tag">&lt;replacementValue property=<span class="code-quote">"buildArgs"</span>&gt;</span>
      <span class="code-tag">&lt;format&gt;</span>-t:{0}<span class="code-tag">&lt;/format&gt;</span>
      <span class="code-tag">&lt;parameters&gt;</span>
        <span class="code-tag">&lt;namedValue name=<span class="code-quote">"CommandToRun"</span> value=<span class="code-quote">"Help"</span>/&gt;</span>
      <span class="code-tag">&lt;/parameters&gt;</span>
    <span class="code-tag">&lt;/replacementValue&gt;</span>
  <span class="code-tag">&lt;/dynamicValues&gt;</span>
<span class="code-tag">&lt;/nant&gt;</span></pre>
</div></div>

<p>Shorthand example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;nant&gt;</span>
  <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;buildArgs&gt;</span>-t:$[CommandToRun|Help]<span class="code-tag">&lt;/buildArgs&gt;</span>
<span class="code-tag">&lt;/nant&gt;</span></pre>
</div></div>

<p>Example in context:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;project name=<span class="code-quote">"Test Project"</span>&gt;</span>
  <span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"svn"</span>&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/sourcecontrol&gt;</span>
  <span class="code-tag">&lt;triggers&gt;</span>
    <span class="code-tag">&lt;intervalTrigger /&gt;</span>
  <span class="code-tag">&lt;/triggers&gt;</span>
  <span class="code-tag">&lt;tasks&gt;</span>
    <span class="code-tag">&lt;nant&gt;</span>
      <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
      <span class="code-tag">&lt;buildArgs&gt;</span>-t:Help<span class="code-tag">&lt;/buildArgs&gt;</span>
      <span class="code-tag">&lt;dynamicValues&gt;</span>
        <span class="code-tag">&lt;replacementValue property=<span class="code-quote">"buildArgs"</span>&gt;</span>
          <span class="code-tag">&lt;format&gt;</span>-t:{0}<span class="code-tag">&lt;/format&gt;</span>
          <span class="code-tag">&lt;parameters&gt;</span>
            <span class="code-tag">&lt;namedValue name=<span class="code-quote">"CommandToRun"</span> value=<span class="code-quote">"Help"</span>/&gt;</span>
          <span class="code-tag">&lt;/parameters&gt;</span>
        <span class="code-tag">&lt;/replacementValue&gt;</span>
      <span class="code-tag">&lt;/dynamicValues&gt;</span>
    <span class="code-tag">&lt;/nant&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/tasks&gt;</span>
  <span class="code-tag">&lt;publishers&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/publishers&gt;</span>
  <span class="code-tag">&lt;parameters&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- Omitted for brevity --&gt;</span></span>
  <span class="code-tag">&lt;/parameters&gt;</span>
<span class="code-tag">&lt;/project&gt;</span></pre>
</div></div>

<h3><a name="ReplacementDynamicValue-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> property </td>
<td class='confluenceTd'> The name of the property to set. This is the same name as what is in the configuration. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>n/a</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> parameters </td>
<td class='confluenceTd'> The parameters to use. Name is the name of the parameter, while value is the default value to use if the parameter has not been set. </td>
<td class='confluenceTd'> List of NamedValues </td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>n/a</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
<tr>
<td class='confluenceTd'> format </td>
<td class='confluenceTd'> The format string to use. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> Yes </td>
<td class='confluenceTd'> <em>n/a</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

<h3><a name="ReplacementDynamicValue-Notes"></a>Notes</h3>

<p>The format string is any standard .NET format string that can be used with string.Format(). The parameters will be replaced in the order that they are defined in the parameters property.</p>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>